package com.xmotor.test_BitSit_BloomFileter;

/**
 * @Description 测试
 * @Author Dang Xianyue
 * @Date 2020-08-04 23:44
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        BloomFileter bloomFileter = new BloomFileter();
        System.out.println(bloomFileter.contains("5324512515"));
        bloomFileter.add("5324512515");

        //维护1亿个在线用户
        for (int i = 1 ; i < 100000000 ; i ++){
            bloomFileter.add(String.valueOf(i));
        }

        long begin = System.currentTimeMillis();
        System.out.println(begin);
        System.out.println(bloomFileter.contains("5324512515"));
        long end = System.currentTimeMillis();
        System.out.println(end);
        System.out.println("判断5324512515是否在线使用了:" + (end - begin));
    }
}
